def count_str(strs):
    int_count,str_count,spa_count,other_count=0,0,0,0
    for i in strs:
        if i.isdigit():
            int_count +=1
        elif i.isalnum():
            str_count +=1
        elif i.isspace():
            spa_count +=1
        else:
            other_count +=1
            print("字符串s中,数字个数={},字母个数={},空格个数={},其他个数={}".format(int_count,str_count,spa_count,other_count))
            if __name__ ==" __main__ ":
                strs=input("请输入字符串s:")
                count_str(strs)

